# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=cargo-flamegraph
pkgver=0.6.3
pkgrel=1
pkgdesc='Easy flamegraphs for Rust projects and everything else'
url="https://github.com/flamegraph-rs/flamegraph"
depends=('perf')
makedepends=('cargo')
arch=('loong64' 'x86_64')
license=('MIT' 'Apache')
source=(https://github.com/flamegraph-rs/flamegraph/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
b2sums=('a8dde42941cf9e2c5b8c69080d72e3c796f835658f2531304e47fb2d6aa07c48b881b5ffaf86f419ef8e6c8b8ebae4d167a7311d4a1b66cbb57fc459770b7c50')

build() {
  cd "flamegraph-${pkgver}"
  cargo build --release --locked
}

check() {
  cd "flamegraph-${pkgver}"
  cargo test --release --locked
}

package() {
  cd "flamegraph-${pkgver}"
  install -Dm755 -t "${pkgdir}/usr/bin" \
    target/release/cargo-flamegraph \
    target/release/flamegraph
  install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm644 LICENSE-MIT -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim:set ts=2 sw=2 et:
